package com.wnn.demo.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
* Created by Mybatis Generator on 2019/09/15
*/
@Table(name = "sys_permission")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Permission implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "permission_id")
    private String permissionId;

    /**
     * 权限名称
     */
    private String title;

    /**
     * 权限类型(1、菜单 2、权限)
     */
    private Integer type=1;

    /**
     * 父节点
     */
    @Column(name = "parent_id")
    private String parentId;

    /**
     * 排序号
     */
    @Column(name = "sort_number")
    private Integer sortNumber=99;

    /**
     * 菜单图标
     */
    private String icon;

    /**
     * 请求方法
     */
    @Column(name = "href_method")
    private String hrefMethod;

    /**
     * 请求路径
     */
    private String href;

    /**
     * 菜单是否展开 (0关闭，1展开)
     */
    private Byte spread=Byte.parseByte("0");

    /**
     * 权限代码
     */
    private String code;

    /**
     * 是否可见(1可见0不可见)
     */
    private Integer enable=1;


    /**
     *  节点是否被选中
     */
    @Transient
    private Integer checked;

    /**
     * 创建时间
     */
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @Column(name = "update_time")
    private Date updateTime;

}